package com.cuit.freshmanMS.query;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class StudentQuery {
    //当前页
    private Integer currentPage = 1;//设置了默认值
    //页面大小
    private Integer pageSize = 10;//设置了默认值
    //关键字
    private String snameK;
    private String snoK;//学号
    private String sidK;//身份证号
    private String dnoK;//寝室号
    private String cnameK;//班级
    private String anameK;//学院

    //获取起始位置
    public Integer getStart() {
        return (this.currentPage - 1) * this.pageSize;
    }

    public String getCnameK() {
        if (cnameK == null) {
            return "";
        } else {
            return cnameK;
        }
    }

    public String getAnameK() {
        if (anameK == null) {
            return "";
        } else {
            return anameK;
        }
    }
}
